//
//  JSExample.cpp
//  SPJSBind
//
//  Created by cc on 12-6-7.
//  Copyright (c) 2012年 触控科技. All rights reserved.
//

#include "JSExample.h"

INIT_JS_CLASS(CExample)

JS_FUNCTION_BEGIN(CExample)
    JS_FUNCTION_BIND(GetThis, 0)
JS_FUNCTION_BIND

JS_PROPERTY_GET_BEGIN(CExample)
    JS_PROPERTY_GET_BIND(CExample_BVar, GetBoolVar, RETURN_BOOL)
    JS_PROPERTY_GET_BIND(CExample_IVar, GetIntVar, RETURN_INT)
    JS_PROPERTY_GET_BIND(CExample_DVar, GetDoubleVar, RETURN_DOUBLE)
    JS_PROPERTY_GET_BIND(CExample_SVar, GetStrVar, RETURN_STRING)
JS_PROPERTY_GET_END

JS_PROPERTY_SET_BEGIN(CExample)
    JS_PROPERTY_SET_BIND(CExample_BVar, GetBoolVar, PARAM_JSBOOL, bool)
    JS_PROPERTY_SET_BIND(CExample_IVar, GetIntVar, PARAM_JSINT, int)
    JS_PROPERTY_SET_BIND(CExample_DVar, GetDoubleVar, PARAM_JSDOUBLE, double)
    JS_PROPERTY_SET_BIND(CExample_SVar, GetStrVar, PARAM_JSSTRING, char*)
JS_PROPERTY_SET_END

JS_PROPERTY_BEGIN(CExample)
    JS_PROPERTY_BIND("m_bBoolVar", CExample_BVar)
    JS_PROPERTY_BIND("m_nIntVar", CExample_IVar)
    JS_PROPERTY_BIND("m_dDoubleVar", CExample_DVar)
    JS_PROPERTY_BIND("m_StrVar", CExample_SVar)
JS_PROPERTY_END

CExample::CExample()
{
    CREATE_JS_OBJECT(CExample)
}

CExample::~CExample()
{
}

CExample* CExample::GetThis()
{
    return this ;
}